home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus Leser 15 / Amiga Plus Leser CD 15.iso / Tools / Hardware / DelfTweak / Install < prev    next >
Encoding:
Text File  |  2002-03-13  |  11.3 KB  |  317 lines

  1. ;-----------------------------------------------------------------------------
  2. ; TITLE        : Install
  3. ; VERSION      : 1.0
  4. ; DATE         : 24.02.2002
  5. ; DESCRIPTION  : Installer script for DelfTweak
  6. ; INPUT        : -
  7. ; OUTPUT       : -
  8. ;-----------------------------------------------------------------------------
  9. ; MODIFICATIONS: -
  10. ;-----------------------------------------------------------------------------
  11. ; LIMITATIONS AND BUGS
  12. ; -
  13. ;-----------------------------------------------------------------------------
  14.  
  15. ; $VER: Install 1.0 (23.02.2002)
  16.  
  17. ;-----------------------------------------------------------------------------
  18. ; VARIABLES VARIABLES VARIABLES VARIABLES VARIABLES VARIABLES VARIABLES VARIA
  19. ;-----------------------------------------------------------------------------
  20. (set #config_ok 1)                       ; Default: configuration is ok
  21. (set #cpu "???(20|30|40|60)")            ; Required CPU
  22. (set #installer_ver 43)                  ; Minimum Installer version
  23. (set #installer_rev 3)                   ; Minimum Installer revision
  24. (set #os_ver 40)                         ; Minimum OS version
  25. (set #os_rev 10)                         ; Minimum OS revision
  26. (set #appsize 1000000)                   ; Required diskspace for application
  27.                                          ; (bytes)
  28. (set #configcheckmask %001)              ; Configuration check mask:
  29.                                          ; bit0 (right)  = cpu
  30.                                          ; bit1 (middle) = os version
  31.                                          ; bit2 (left)   = disk space
  32. (set #application "DelfTweak")           ; Application
  33.  
  34. ; Default language (English)
  35. (set #string1 ("\nInstaller version %ld.%ld required.\nPlease check your configuration." #installer_ver #installer_rev))
  36. (set #string2 ("\n%s\n\nCopyright © 2002 Janne Peräaho.\nAll Rights Reserved." #application))
  37. (set #string3 ("\n%s has now been installed.\nYou may now reboot your Amiga." #application))
  38. (set #string4 "\nAt least 68020 CPU, Installer version 43.3 and delfina.library required.\nPlease check your configuration.")
  39. (set #string5 "\nSelect components to be installed.")
  40. (set #string50 "\nSOFTWARE COMPONENTS\n\nDelfTweak package consists of binary executable (DelfTweak), Amiga guide documentation (DelfTweak.guide), and AmigaDOS scripts.\n\nIn this section you may select the prefered software components to be installed.")
  41. (set #string51 "DelfTweak           (about  17 kB)")
  42. (set #string52 "Documentation       (about  27 kB)")
  43. (set #string53 "Overclocking script (about 100 B )")
  44. (set #string6 "\nSelect new clock frequency for Delfina Lite.")
  45. (set #string60 "\nCLOCK FREQUENCY\n\nHere you may select a startup script which will set a new clock frequency for your Delfina Lite.\n\nIf you do not have a standard 40 MHz Delfina Lite, DO NOT INSTALL ANY OF THESE SCRIPTS! They may cause permanent damage to nonstandard Delfina Lite or other Delfina models.")
  46. (set #string61 "40 MHz (default clock speed)")
  47. (set #string62 "44 MHz (10% overclocking)")
  48. (set #string63 "48 MHz (20% overclocking)")
  49. (set #string64 "52 MHz (30% overclocking)")
  50. (set #string65 "56 MHz (40% overclocking)")
  51. (set #string66 "60 MHz (50% overclocking)")
  52. (set #string67 "64 MHz (60% overclocking)")
  53. (set #string601 "(40MHz|40MHz.info)") ; Script file names
  54. (set #string602 "(44MHz|44MHz.info)")
  55. (set #string603 "(48MHz|48MHz.info)")
  56. (set #string604 "(52MHz|52MHz.info)")
  57. (set #string605 "(56MHz|56MHz.info)")
  58. (set #string606 "(60MHz|60MHz.info)")
  59. (set #string607 "(64MHz|64MHz.info)")
  60. (set #string7 "\nSelect target directory for DelfTweak.")
  61. (set #string70 "\nINSTALLING DELFTWEAK\n\nDelfTweak will be copied to the selected directory.")
  62. (set #string71 "C:")
  63. (set #string72 "\nSelect target directory for DelfTweak documentation (HELP: directory recommended).")
  64. (set #string73 "\nINSTALLING DELFTWEAK DOCUMENTATION\n\nDelfTweak.guide will be copied to the selected directory.")
  65. (set #string74 "HELP:")
  66. (set #string75 "\nSelect target directory for overclocking script (SYS:WBStartup directory recommended).")
  67. (set #string76 "\nINSTALLING OVERCLOCKING SCRIPT\n\nOverclocking script will be copied to the selected directory.")
  68. (set #string77 "SYS:WBStartup/")
  69. (set #string8 "\nInstalling DelfTweak...")
  70. (set #string80 "\nINSTALLING DELFTWEAK\n\nDelfTweak will be copied into the target directory.")
  71. (set #string81 "Executables/")
  72. (set #string82 "#?")
  73. (set #string83 "\nInstalling DelfTweak documentation...")
  74. (set #string84 "\nINSTALLING DOCUMENTATION\n\nDelfTweak.guide will be copied into the target directory.")
  75. (set #string85 "Docs/")
  76. (set #string86 "DelfTweak(.guide|.guide.info)")
  77. (set #string87 "Installing overclocking script...")
  78. (set #string88 "\nINSTALLING OVERCLOCKING SCRIPT\n\nOverclocking script will be copied into the target directory.")
  79. (set #string89 "Settings/Delfina Lite 40 MHz/")
  80. (set #string8a #string601) ; Name of the overclocking script file to be installed
  81.  
  82. ;-----------------------------------------------------------------------------
  83. ; SUBROUTINES SUBROUTINES SUBROUTINES SUBROUTINES SUBROUTINES SUBROUTINES SUB
  84. ;-----------------------------------------------------------------------------
  85. ;-----------------------------------------------------------------------------
  86. ; TITLE        : p_DecodeVersion
  87. ; VERSION      : 0.10
  88. ; DATE         : 30.08.1998
  89. ; DESCRIPTION  : Get version and revision from raw version number
  90. ; INPUT        : #version - raw version number
  91. ; OUTPUT       : #ver     - version number
  92. ;                #rev     - revision number
  93. ;-----------------------------------------------------------------------------
  94. ; MODIFICATIONS: -
  95. ;-----------------------------------------------------------------------------
  96. (procedure p_DecodeVersion #version
  97.    (set #ver (/ #version 65536))
  98.    (set #rev (- #version (* #ver 65536)))
  99. )
  100.  
  101. ;-----------------------------------------------------------------------------
  102. ; TITLE        : p_EncodeVersion
  103. ; VERSION      : 0.10
  104. ; DATE         : 30.08.1998
  105. ; DESCRIPTION  : Create raw version number from version and revision number
  106. ; INPUT        : #ver     - version number
  107. ;                #rev     - revision number
  108. ; OUTPUT       : #version - raw version number
  109. ;-----------------------------------------------------------------------------
  110. ; MODIFICATIONS: -
  111. ;-----------------------------------------------------------------------------
  112. (procedure p_EncodeVersion #ver #rev
  113.    (set #version (+ (* #ver 65536) #rev))
  114. )
  115.  
  116. ;-----------------------------------------------------------------------------
  117. ; TITLE        : p_CheckConfiguration
  118. ; VERSION      : 0.10
  119. ; DATE         : 30.08.1998
  120. ; DESCRIPTION  : Check if requirements match with current configuration
  121. ; INPUT        : -
  122. ; OUTPUT       : #config_ok - 0=not ok, 1=ok
  123. ;-----------------------------------------------------------------------------
  124. ; MODIFICATIONS: -
  125. ;-----------------------------------------------------------------------------
  126. (procedure p_CheckConfiguration
  127.  
  128.    ; Variables
  129.    (set #config_ok 1)
  130.  
  131.    ; Check CPU
  132.    (if (in #configcheckmask 0)
  133.       (
  134.          (if (not (patmatch #cpu (database "cpu")))
  135.             (
  136.                (set #config_ok 0)
  137.             )
  138.          ); if
  139.       )
  140.    ); if
  141.  
  142.    ; Check OS version
  143.    (if (in #configcheckmask 1)
  144.       (
  145.          (p_EncodeVersion #os_ver #os_rev)
  146.          (if (< #version (getversion))
  147.             (set #config_ok 0)
  148.          ); if
  149.       )
  150.    ); if
  151.  
  152.    ; Check diskspace
  153.    (if (in #configcheckmask 2)
  154.       (
  155.          (set #availdspace (getdiskspace @default-dest))
  156.          ; Information not available
  157.          (if (not (< #availdspace 0))
  158.             ; Not enough room
  159.             (if (< #availdspace #appsize)
  160.                (set #config_ok 0)
  161.             ); if
  162.          ); if
  163.       )
  164.    ); if
  165.  
  166. ); p_CheckConfiguration
  167.  
  168. ;-----------------------------------------------------------------------------
  169. ; TITLE        : p_GetDestination
  170. ; VERSION      : 0.10
  171. ; DATE         : 30.08.1998
  172. ; DESCRIPTION  : Get destination directory
  173. ; INPUT        : -
  174. ; OUTPUT       : @default-dest
  175. ;-----------------------------------------------------------------------------
  176. ; MODIFICATIONS: -
  177. ;-----------------------------------------------------------------------------
  178. (procedure p_GetDestination #d1string #d2string #d3string
  179.  
  180.    (set @default-dest
  181.       (askdir
  182.          (prompt #d1string)
  183.          (help #d2string)
  184.          (default #d3string)
  185.          (disk)
  186.       ); askdir
  187.    )
  188. ); p_GetDestination
  189.  
  190. ;-----------------------------------------------------------------------------
  191. ; TITLE        : p_CopyFiles
  192. ; VERSION      : 0.10
  193. ; DATE         : 30.08.1998
  194. ; DESCRIPTION  : Copy files
  195. ; INPUT        : -
  196. ; OUTPUT       : -
  197. ;-----------------------------------------------------------------------------
  198. ; MODIFICATIONS: -
  199. ;-----------------------------------------------------------------------------
  200. (procedure p_CopyFiles #c1string #c2string #c3string #c4string
  201.  
  202.    (copyfiles
  203.       (prompt #c1string)
  204.       (help #c2string)
  205.       (source #c3string)
  206.       (dest @default-dest)
  207.       (pattern #c4string)
  208.       (optional "force")
  209.    ); copyfiles
  210.  
  211. ); p_CopyFiles
  212.  
  213. ;-----------------------------------------------------------------------------
  214. ; MAIN MAIN MAIN MAIN MAIN MAIN MAIN MAIN MAIN MAIN MAIN MAIN MAIN MAIN MAIN
  215. ;-----------------------------------------------------------------------------
  216. ; Welcome message
  217. (welcome #string2)
  218.  
  219. ; Check Installer version
  220. (p_EncodeVersion #installer_ver #installer_rev)
  221. (if (< @installer-version #version)
  222.    (
  223.       (exit #string1 (quiet))
  224.    )
  225. ); if
  226.  
  227. ; Ask options (software packages to install)
  228. (set #installoptions
  229.    (askoptions
  230.       (prompt #string5)
  231.       (help #string50)
  232.       (choices #string51 #string52 #string53)
  233.       (default %111)
  234.    ); askoptions
  235. )
  236.  
  237. ; Last option - Overclocking script (ask clock speed)
  238. (if (in #installoptions 2)
  239.    ; Ask overclocking frequency 
  240.    (
  241.       (set #frequencychoice
  242.          (askchoice
  243.             (prompt #string6)
  244.             (help #string60)
  245.             (choices #string61 #string62 #string63 #string64 #string65 #string66 #string67)
  246.             (default 0)
  247.          ); askoptions
  248.       )
  249.       ; Get and set script name
  250.       (set #string8a
  251.          (select #frequencychoice
  252.             (#string601)
  253.             (#string602)
  254.             (#string603)
  255.             (#string604)
  256.             (#string605)
  257.             (#string606)
  258.             (#string607)
  259.          ); select
  260.       )
  261.    )
  262. ); if
  263.  
  264. ; First option - DelfTweak
  265. (if (in #installoptions 0)
  266.    (
  267.       ; Get destination directory
  268.       (p_GetDestination #string7 #string70 #string71)
  269.  
  270.       ; Check configuration
  271.       (p_CheckConfiguration)
  272.       (if (< #config_ok 1)
  273.          (exit #string4 (quiet))
  274.       ); if
  275.  
  276.       ; Copy files
  277.       (p_CopyFiles #string8 #string80 #string81 #string82)
  278.    )
  279. ); if
  280.  
  281. ; Second option - Documentation
  282. (if (in #installoptions 1)
  283.    (
  284.       ; Get destination directory
  285.       (p_GetDestination #string72 #string73 #string74)
  286.  
  287.       ; Check configuration
  288.       (p_CheckConfiguration)
  289.       (if (< #config_ok 1)
  290.          (exit #string4 (quiet))
  291.       ); if
  292.  
  293.       ; Copy files
  294.       (p_CopyFiles #string83 #string84 #string85 #string86)
  295.    )
  296. ); if
  297.  
  298. ; Last option - Overclocking
  299. (if (in #installoptions 2)
  300.    (
  301.       ; Get destination directory
  302.       (p_GetDestination #string75 #string76 #string77)
  303.  
  304.       ; Check configuration
  305.       (p_CheckConfiguration)
  306.       (if (< #config_ok 1)
  307.          (exit #string4 (quiet))
  308.       ); if
  309.  
  310.       ; Copy files
  311.       (p_CopyFiles #string87 #string88 #string89 #string8a)
  312.    )
  313. ); if
  314.  
  315. ; All done
  316. (exit #string3 (quiet))
  317.